package Example1;

public class NoRelationshipClass {
    public static String staticVar="这是个静态变量";
    public static String globalVar="这是个全局变量";
    public String name;
    public Integer age;

    //初始化代码块
    {
        System.out.println("NoRelationshipClass 的初始化代码块");
        name="名字";
        age=28;
    }

    static {
        System.out.println("看看定义的静态变量赋值了没有: globalVar="+globalVar);
        System.out.println("NoRelationshipClass的静态代码块");
    }

    public NoRelationshipClass(){
        System.out.println("NoRelationshipClass 的构造方法");
    }

    public void sayHello(){
        System.out.println("Hello，this is a normal method！！！");
    }
}
